﻿/*******************************************************
* Copyright (c) 2018-2088, By XuXiang all rights reserved.
*
* FileName: MatchInfo.h
* Summary: 匹配信息。
*
* Author: XuXiang
* Date: 2024-04-24 23:35
*******************************************************/

#ifndef __MatchInfo_h__
#define __MatchInfo_h__

#include <map>
#include <vector>
#include <string>
#include <Macro.h>
using namespace std;

namespace Competition
{
	class MatchInfo
	{
	public:
		MatchInfo(int user_id);

		//获取用户id
		inline const int GetUserID()const { return m_UserID; }
		//设置用户id
		inline void SetUserID(int uid) { m_UserID = uid; }

		//获取准备状态
		inline const int GetState()const { return m_State; }
		//设置准备状态
		inline void SetState(int state) { m_State = state; }

	private:

		//用户ID。
		int m_UserID;

		//准备状态 0:未准备 1:准备
		int m_State;
	};
	typedef map<int, MatchInfo*> MatchInfoMap;
	typedef vector<MatchInfo*> MatchInfoVector;

	class MatchGroupInfo
	{
	public:
		MatchGroupInfo(int group_id);
		~MatchGroupInfo();

		//获取组编号
		inline const int GetGroupID()const { return m_GroupID; }
		//设置组编号
		inline void SetGroupID(int group_id) { m_GroupID = group_id; }

		//获取准备时间秒
		inline const Int64 GetStartTime()const { return m_StartTime; }
		//设置准备时间秒
		inline void SetStartTime(Int64 time) { m_StartTime = time; }

		//添加匹配信息
		inline void AddMatchInfo(MatchInfo* info) { m_MatchInfos.push_back(info); }

		//获取匹配信息列表
		inline MatchInfoVector& GetMatchInfos() { return m_MatchInfos; }

	private:

		//组编号。
		int m_GroupID;

		//开始准备时间秒
		Int64 m_StartTime;

		//匹配信息列表
		MatchInfoVector m_MatchInfos;
	};
	typedef map<int, MatchGroupInfo*> MatchGroupMap;
	typedef vector<MatchGroupInfo*> MatchGroupVector;
}

#endif